import { pixelPartyModule } from "../module";

export class PixelPartyEndState extends pixelPartyModule.State {
    override onEnter(): void {
        this.context.players.title(
            "§c§l游戏结束",
            `§a§l你坚持到了第§c${this.context.round}§a轮`
        );
        this.context.players.sendMessage(
            "§a§l最终存活玩家:§c" + (this.context.winner?.name ?? "没有人存活")
        );
        this.context.map.defaultStructure.place();
        this.runner.runDelay(() => {
            this.engine.stopGame();
        }, 20);
    }
}
